package com.smooth.site.sx.mag.biz.comp.service;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import com.smooth.common.site.common.persistence.Page;
import com.smooth.dao.gen.BizCompanyMapper;
import com.smooth.dao.gen.bean.BizCompany;
import com.smooth.dao.gen.bean.BizCompanyExample;

@Component
public class BizTreeCompanyService {
	@Autowired
	BizCompanyMapper bizCompanyMapper;
	public Page<BizCompany> findTreeCompanys(Page<BizCompany> page, BizCompany bizCompany){
		BizCompanyExample bizCompanyExample = new BizCompanyExample();
		BizCompanyExample.Criteria criteria = bizCompanyExample.createCriteria();
		
		bizCompanyExample.setPage(page);
		
		List<BizCompany> dlist = bizCompanyMapper.selectByExample(bizCompanyExample);
		page.setList(dlist);
		page.setCount(bizCompanyMapper.countByExample(bizCompanyExample));
		
		return page;
	}
 
	public Page<BizCompany> findTreePage(Page<BizCompany> page, BizCompany bizCompany) {
		BizCompanyExample bizCompanyExample = new BizCompanyExample();
		BizCompanyExample.Criteria criteria = bizCompanyExample.createCriteria();
		
		bizCompanyExample.setPage(page);
		
		List<BizCompany> dlist = bizCompanyMapper.selectByExample(bizCompanyExample);
		page.setList(dlist);
		page.setCount(bizCompanyMapper.countByExample(bizCompanyExample));
		
		return page;
	}
}
